-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.进行iOS系统的适配 #1638
base: master
Are you sure you want to change the base?
1.进行iOS系统的适配 #1638
Conversation
2.FLAnimatedImage替换为最新代码,只做了const BOOL isGIFData = imageSourceContainerType ? UTTypeConformsTo(imageSourceContainerType, kUTTypeGIF) : NO; 判断改动 3.增加TZWindowManager,Window管理类
…tionStatusForAccessLevel:PHAccessLevelReadWrite] iOS14.0判断
…ng for configuration named,解决
resultImage = [self fixOrientation:resultImage]; | ||
if (completion) completion(resultImage,info,NO); | ||
}]; | ||
if (@available(iOS 13.0, *)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个建议抽一个公共方法(可以就放TZImageManager里),这个公共方法里判断iOS13,其它地方调用这个公共方法,可以省许多if代码。现在到处if else,回调处理逻辑重复存在,比较杂乱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已经在TZImageManager 抽一个公共方法 requestImageDataFitSystemForAsset
UIWindowScene *curWinSc = (UIWindowScene *)tmpSc; | ||
return curWinSc.keyWindow; | ||
} else { | ||
return [[[UIApplication sharedApplication] windows] objectAtIndex:0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里用第0个window代替keyWindow稳定吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已经在 TZCommonTools 中currentKeyWindow重新获取keyWindow
[UIApplication sharedApplication].statusBarHidden = NO; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为了兼容iOS9以下系统,要留这么一大段if的话,就不支持iOS9以下了吧...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
要测试下,横竖屏切换是否会让状态栏显示哈,测试正常的话回复下哈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
切换横屏不显示 切换竖屏显示,在iOS13以后
iOS9以下代码删除
isStatusBarHidden = [[TZWindowManager manager] currentWindow].windowScene.statusBarManager.statusBarHidden; | ||
} else { | ||
isStatusBarHidden = [UIApplication sharedApplication].statusBarHidden; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个和对requestImageDataAndOrientationForAsset的调用一样,建议抽成个公共方法,到处去判断太冗余了
可以放到TZCommonTools里
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已经在 TZCommonTools 中currentStatusBarHidden 抽成个公共方法
if (CGRectEqualToRect(keyWindow.bounds, [UIScreen mainScreen].bounds)) { | ||
window = keyWindow; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段取window的逻辑,和[[TZWindowManager manager] currentWindow]不一样,直接替换可能有问题吧?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已经在 TZCommonTools 中currentKeyWindow重新获取keyWindow
CGFloat naviBarHeight = statusBarHeight + _tzImagePickerVc.navigationBar.tz_height; | ||
_naviBar.frame = CGRectMake(0, 0, self.view.tz_width, naviBarHeight); | ||
_backButton.frame = CGRectMake(10, 10 + statusBarHeightInterval, 44, 44); | ||
_selectButton.frame = CGRectMake(self.view.tz_width - 56, 10 + statusBarHeightInterval, 44, 44); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
把10 + statusBarHeightInterval换成statusBarHeight的考虑是?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
让左右两个 Button 对称
@@ -35,7 +37,7 @@ | |||
#define CURRENT_SYSTEM_VERSION [[UIDevice currentDevice] systemVersion] | |||
#define SYSTEM_VERSION_GREATER_THAN_15 ([CURRENT_SYSTEM_VERSION floatValue] >= 15.0) | |||
|
|||
@class TZAlbumCell, TZAssetCell; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里改成import TZAssetCell是?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Umbrella header for module 'TZImagePickerController' does not include header 'TZAssetCell.h'
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didChangeStatusBarOrientationNotification:) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil]; | ||
} | ||
|
||
-(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注意风格哈,-后面有个空格
- (void)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已解决
2.FLAnimatedImage替换为最新代码,只做了const BOOL isGIFData = imageSourceContainerType ? UTTypeConformsTo(imageSourceContainerType, kUTTypeGIF) : NO; 判断改动 3.增加TZWindowManager,Window管理类